package org.zoomdev.zoom.aop.modules;

import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.Opcodes;
import org.zoomdev.zoom.aop.utils.AsmUtils;

public final class RenameClassAdapter extends ClassVisitor {
    private final String newClassName;

    public RenameClassAdapter(ClassVisitor cv, String newClassName) {
        super(Opcodes.ASM9, cv);
        this.newClassName = AsmUtils.makeExternalName(newClassName);
    }

    @Override
    public void visit(int version, int access, String name, String signature,
                      String superName, String[] interfaces) {
        // 修改原始类名为新名称
        super.visit(version, access, newClassName, signature, superName, interfaces);
    }


}